package net.huashitong.zhApp.service;

import net.huashitong.node.service.NodeNewschedulesService;
import net.huashitong.oversee.entity.SupervisionTask;
import net.huashitong.oversee.filter.SupervisionTaskFilter;
import net.huashitong.oversee.service.SupervisionTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OperationLogEffectService {

    @Lazy
    @Autowired
    private SupervisionTaskService taskService;
    @Lazy
    @Autowired
    private NodeNewschedulesService nodeNewschedulesService;


    /**
     * 最近7天，重大系统生成的督查任务数
     * @return
     */
    public int queryTaskNumInWeek(){
        SupervisionTaskFilter filter = new SupervisionTaskFilter();
        filter.setEffectFlag("1");      //成效标志
        List<SupervisionTask> list = taskService.querySupervisionTaskByFilter(filter);
        return list.size();
    }

    /**
     * 运行成效（一周时间完成几条节点任务）
     * @return
     */
    public int queryFinishNodesNumInWeek(){
        return nodeNewschedulesService.queryFinishNodesNumInWeek();
    }

    public int queryMessageNumInWeek(){
        return nodeNewschedulesService.queryFinishNodesNumInWeek();
    }


}
